package be.bonamis.umpire.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import be.bonamis.umpire.domain.notary.Barema;

public interface BaremaRepository extends JpaRepository<Barema, Integer> {
	Barema findByCode(String code);
	
	// 
	@Query("SELECT b FROM Barema b join fetch b.slices WHERE LOWER(b.code) = LOWER(:code)")
    public Barema find(@Param("code") String code);

}
